package com.dhcc.core.modules.system.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.dhcc.core.framework.base.service.IBaseService;
import com.dhcc.core.modules.system.entity.PanAttachment;
import com.dhcc.core.modules.system.entity.PanFile;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;

/**
 * 表数据服务层接口
 * 
 * @ClassName: IPanFileService
 * @Description: TODO
 * @author mk
 * @date 2018-08-30 20:44:24
 */
public interface IPanFileService extends IBaseService<PanFile> {
    /**
     * 获取附件通过文件ID
     * @param fileIds
     * @return
     */
    List<PanAttachment> getAttachmentsByFileIds(@Param("fileIds")Long[] fileIds);

    /**
     * 文件上传
     * @param file
     * @param source
     * @param folderId
     * @return
     */
    PanFile fileUpload(MultipartFile file,Integer source,Long folderId);

    /**
     * 获取文件夹中的文件
     * @Title: getUserAttachmentsOfFolder 
     * @Description: TODO
     * @param page
     * @param folderId
     * @param userId
     * @param fileName
     * @param startDate
     * @param endDate
     * @return
     * @return: List<PanAttachment>
     */
    List<PanAttachment> getUserAttachmentsOfFolder(Page<PanAttachment> page,Long folderId,Long userId, String fileName,String startDate, String endDate);

    /**
     * 文件夹下是否存在文件
     * @Title: hasFileOfFolder 
     * @Description: TODO
     * @param folderId
     * @return
     * @return: Boolean
     */
    Boolean hasFileOfFolder(Long folderId);
    /**
     * 转移个人文件夹
     * @param fileIds
     * @param folderId
     */
    void moveToFolder(Long[] fileIds, Long folderId);
    /**
     * 批量删除文件
     * @Title: deleteFile 
     * @Description: TODO
     * @param userId
     * @param fileIds
     * @return: void
     */
    void deleteFile(Long userId,Long[] fileIds);

}
